Parameter expansion also includes some pattern matching capabilities with the same wild card capabilities as used in filename expansion or globbing.
参数扩展还包括了一些模式匹配功能,该功能带有在文件名扩展或globbing中使用的通配符功能。
You may include a "default" case at the end of a pattern match, either using the underscore wild card character or a meaningfully-named variable.
你可以在模式匹配的最后包含一个“default”默认case,可以使用下划线通配符,或者有含义的变量名。
You can use an underscore (Scala's standard wild card character) as a placeholder to catch any type of exception (really, to match any case in a pattern matching expression).
你可以使用一个下划线(Scala的标准通配符)作为占位符来捕捉任意类型的异常(不骗你,它可以匹配模式匹配表达式的任何case)。
应用推荐